package com.nmwlw.demo.utlis;

import android.app.Application;
import android.content.Context;
import android.net.wifi.WifiManager;

public class WifiHelper {
    private final WifiManager wifiManager;

    private WifiHelper(Context context) {
        wifiManager = (WifiManager) context.getApplicationContext().getSystemService(Context.WIFI_SERVICE);
    }

    // 非静态方法获取WiFi开启状态
    public boolean getWifiOpenState() {
        if (wifiManager == null){
            return false;
        }
        return wifiManager.isWifiEnabled();
    }

}
